package be.nepherte.movmanager.client.util;

import be.nepherte.movmanager.client.ui.components.AbstractMoviesView;
import be.nepherte.movmanager.client.ui.components.MovieDetailsView;
import be.nepherte.movmanager.client.ui.components.MovieListView;

/**
 * This class is a factory that creates movies views.
 * 
 * <p>
 * Copyright © 2010 Bart Verhoeven
 * </p>
 * 
 * <p>
 * This file is part of MovManager.
 * </p>
 * 
 * <p>
 * MovManager is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * </p>
 * 
 * <p>
 * MovManager is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * </p>
 * 
 * <p>
 * You should have received a copy of the GNU General Public License along with
 * MovManager. If not, see http://www.gnu.org/licenses/.
 * </p>
 * 
 * @author 	Bart Verhoeven
 * @version	0.1
 */
public class MoviesViewFactory {
		public enum MoviesViewType {
		MovieListView,
		
		MovieDetailsView
	}
	
	/**
	 * Default empty constructor.
	 */
	public MoviesViewFactory() {}
	
	/**
	 * Creates a new movies view.
	 * 
	 * @param	type
	 * 			type of movies view you want to create
	 */
	public static AbstractMoviesView createMoviesView(MoviesViewType type) {
		switch (type) {
			case MovieDetailsView:
				return new MovieDetailsView();
			
			case MovieListView:
				return new MovieListView(10);
		}
		
		throw new IllegalArgumentException("The movie view " + type + " is not recognized.");
	}
	
	/**
	 * Gets the default movies view (MovieListView).
	 * 
	 * @return	an instance of the default movies view.
	 */
	public static AbstractMoviesView getDefaultMoviesView() {
		return new MovieListView(10);
	}

}
